<?php
include_once("../../commonFunctions.php");
$store = new Store($_SESSION['storeAbbrev']);
$dealer = new Dealer($_SESSION['dealerCode']);

$store = new Store($_SESSION['storeAbbrev']);
$value2 = $_GET['value2'];
$_SESSION['value2'] = $value2;
$value1 = $_SESSION['value1'];

if ($value1 == "Maintenance") {
    $query = "select description from maintenance where type='" . $value2 .  "';";
    $result = mysql_query($query) or die("failed in maintenance if statement submitNewTT_2.php " . $query);
    while ($row = mysql_fetch_array($result)) {
        echo $row["description"] . ',';
    }
    echo 'Maintenance Issue: ';
} else if ($value1 == "Merchandising") {
    $query = "select description from merchandising where type='" . $value2 .  "';";
    $result = mysql_query($query) or die("failed in Merchandising if statement submitNewTT_2.php " . $query . "<br>" . mysql_error());
    while ($row = mysql_fetch_array($result)) {
        echo $row['description'] . ',';
    }
    echo 'Merchandising Issue: ';
} else if ($value1 == "Computer") {
    $query = "select distinct type from computerissues;";
    $result = mysql_query($query) or die("failed in Computer if statement submitNewTT_2.php " . $query);
    while ($row = mysql_fetch_array($result)) {
        echo $row['type'] . ',';
    }
    echo 'Type Of Computer Issue: ';
} else if ($value1 == "storePrinter") {
    $query = "select distinct description from printerissues;";
    $result = mysql_query($query) or die("failed in Computer if statement submitNewTT_2.php " . $query);
    while ($row = mysql_fetch_array($result)) {
        echo $row['description'] . ',';
    }
    echo 'Type Of Printer Issue: ';
}
?>
